/**************************************************************************
 *
 *        Copyright (c) 2008-2008 by Sunplus mMedia Inc., Ltd.
 *
 *  This software is copyrighted by and is the property of Sunplus
 *  mMedia Inc., Ltd. All rights are reserved by Sunplus mMedia
 *  Inc., Ltd. This software may only be used in accordance with the
 *  corresponding license agreement. Any unauthorized use, duplication,
 *  distribution, or disclosure of this software is expressly forbidden.
 *
 *  This Copyright notice MUST not be removed or modified without prior
 *  written consent of Sunplus mMedia Inc., Ltd.
 *
 *  Sunplus mMedia Inc., Ltd. reserves the right to modify this
 *  software without notice.
 *
 *  Sunplus mMedia Inc., Ltd.
 *  19-1, Innovation First Road, Science-Based Industrial Park,
 *  Hsin-Chu, Taiwan, R.O.C.
 *
 **************************************************************************/
/**
 * @file		hal_gpio.h
 * @brief		hal gpio header file.
 * @author		Matt Wang
 * @since		2008-05-27
 * @date		2009-02-25
 */
#ifndef __HAL_GPIO_API_H__
#define __HAL_GPIO_API_H__

/**************************************************************************
 *                              C O N S T A N T S
 **************************************************************************/
typedef enum {
	HAL_GPIO_BYTE_NULL,
	HAL_GPIO_BYTE_GEN0,   /* gpio[7:0]      */
	HAL_GPIO_BYTE_GEN1,   /* gpio[15:8]     */
	HAL_GPIO_BYTE_GEN2,   /* gpio[23:16]    */
	HAL_GPIO_BYTE_GEN3,   /* gpio[31:24]    */
	HAL_GPIO_BYTE_FM0,    /* fmgpio[3:0]    */
	HAL_GPIO_BYTE_FM1,    /* fmgpio[9:4]    */
	HAL_GPIO_BYTE_FM2,    /* fmgpio[17:10]  */
	HAL_GPIO_BYTE_TG0,    /* tggpio[5:0]    */
	HAL_GPIO_BYTE_DISP0,  /* tvegpio[7:0]   */
	HAL_GPIO_BYTE_DISP1,  /* tvegpio[15:8]  */
	HAL_GPIO_BYTE_DISP2,  /* tvegpio[21:16] */
	HAL_GPIO_BYTE_P1,     /* p1[7:0]        */
	HAL_GPIO_BYTE_MA1,    /* ma[14:14]      */
	HAL_GPIO_BYTE_RGB0,   /* rgb[7:0]       */
	HAL_GPIO_BYTE_RGB1,   /* rgb[9:8]       */
	HAL_GPIO_BYTE_MAX,
} HAL_GpioByte_e;

/**************************************************************************
 *                  F U N C T I O N   D E C L A R A T I O N S
 **************************************************************************/
void  HAL_GpioByteFuncSet(UINT8 byteId, UINT8 msk, UINT8 func);
UINT8 HAL_GpioByteFuncGet(UINT8 byteId, UINT8 msk);
void  HAL_GpioByteDirSet(UINT8 byteId, UINT8 msk, UINT8 dir);
UINT8 HAL_GpioByteDirGet(UINT8 byteId, UINT8 msk);
void  HAL_GpioByteOutSet(UINT8 byteId, UINT8 msk, UINT8 val);
void  HAL_GpioByteOutSet_Intr(UINT8 byteId, UINT8 msk, UINT8 val);
UINT8 HAL_GpioByteOutGet(UINT8 byteId, UINT8 msk);
void  HAL_GpioByteInGateSet(UINT8 byteId, UINT8 msk, UINT8 gate);
UINT8 HAL_GpioByteInGet(UINT8 byteId, UINT8 msk);
void  HAL_PullEnSet(UINT8 byteId, UINT8 msk, UINT8 en);
UINT8 HAL_PullEnGet(UINT8 byteId, UINT8 msk);

#endif  /* __HAL_GPIO_API_H__ */

